//
//  CountDownBtn.m
//  OAX
//
//  Created by a on 2021/8/10.
//  Copyright © 2021 YeMing. All rights reserved.
//

#import "CountDownBtn.h"

BOOL hasLiked = YES;

@implementation CountDownBtn

-(void)sendAction:(SEL)action to:(id)target forEvent:(UIEvent *)event{

    if (hasLiked) {  // 点击的时候判断hasLiked
        hasLiked = NO;// 执行弹框前设置
        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
            hasLiked = YES; //弹框完成后延时2秒在设置
        });
        
        if(self.delegate != NULL){
            [self.delegate BtnClick:self];
        }
    }
}

@end
